<local:DocumentBase x:Class="WPFExcelReport.YCAMDPLAN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                                xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    FontSize="16" 
                    MinHeight="800"
                    Background="White" 
                    Loaded="Windows_Loaded"
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="Set4ITX" />
        <db:SETINTEXDB  x:Key="SetTmp" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwXDECK" Source="{Binding Path=ICC_XDECK,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwITXXDECK" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwITXSTOCK" Source="{Binding Path=ICC_STOCK,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwITXEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwTMPEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource SetTmp}}" />
        <CollectionViewSource   x:Key="vwITXABPOS" Source="{Binding Path=ABPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwITXAB15" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource Set4ITX}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
            <RowDefinition Height="*" MinHeight="300"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
            <WrapPanel Name="zoneCommand" Margin="4,0,51,6" IsEnabled="False" Visibility="Collapsed">
                <Label Content="{Binding Source={Localization:Translate Word=系统}}" Width="40" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="1" >00</TextBox>
                <Label Content="{Binding Source={Localization:Translate Word=语言}}" Width="40" Margin="0,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                <Label Content="{Binding Source={Localization:Translate Word=用户名}}" Width="60" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                <Label Content="{Binding Source={Localization:Translate Word=密码}}" Width="40" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow" FontSize="18" KeyboardNavigation.TabIndex="1" TabIndex="4" />
                <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                    登录
                </Button>
                <CheckBox FontSize="14" Content="{Binding Source={Localization:Translate Word=属于评审组}}" Name="IsBelongs2V9"
                              Visibility="Hidden"></CheckBox>
                <TextBlock FontSize="14" MinWidth="200" Width="Auto" Name="MemberV9" Background="#FF00AF00"
                               Visibility="Hidden"></TextBlock>
                <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
            </WrapPanel>
            <WrapPanel >
                <Button Name="btnRefresh" Width="40" Height="40"  Click="btnRefresh_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/IntexReportClient;component/Images/Reload.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="28"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=计划}}" VerticalAlignment="Center"/>
                <CheckBox Name="ChkPlanMode" VerticalAlignment="Center" IsChecked="True">
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock FontSize="28"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=留位}}" VerticalAlignment="Center"/>
                <CheckBox Name="ChkMatMode" VerticalAlignment="Center" Checked="ChkMatMode_Checked">
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock FontSize="28"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=覆盖}}" VerticalAlignment="Center"/>
                <CheckBox Name="ChkOverride" VerticalAlignment="Center" >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock FontSize="28"    Width="Auto"  Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=已完成}}" VerticalAlignment="Center"/>
                <CheckBox Name="ChkPlanned" VerticalAlignment="Center" >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock FontSize="28" Margin="10,0,0,0"  Text="{Binding Source={Localization:Translate Word=可用数量:}}"></TextBlock>
                <TextBlock FontSize="28" Name="SType" Margin="10,0,0,0" Width="40" Background="Yellow"></TextBlock>
                <TextBlock FontSize="28" Name="SKRS" Margin="10,0,0,0" Width="60" Background="Green"></TextBlock>
                <TextBlock FontSize="28" Name="SLFD" Margin="10,0,0,0" Width="100" Background="Gray"></TextBlock>
                <TextBlock FontSize="28"  Name="SPOS" Margin="10,0,0,0" Width="80" Background="Pink"></TextBlock>
                <TextBlock FontSize="28" Name="SQTY" Margin="10,0,0,0" Width="120" Background="White" Foreground="Red"></TextBlock>
                <TextBlock FontSize="28" Name="SAID" Margin="10,0,0,0" Width="120" Background="Gray" Visibility="Hidden"></TextBlock>
            </WrapPanel>
        </StackPanel>
        <DockPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="4" LastChildFill="True">
            <Expander DockPanel.Dock="Top" Header="{Binding Source={Localization:Translate Word=款式明细}}" ExpandDirection="Up" IsExpanded="True" MaxHeight="300" >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1.5*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" >
                        <TextBlock FontSize="18"   Width="Auto" Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=款式:}}" VerticalAlignment="Center" />
                        <StackPanel>
                            <TextBox Background="Yellow"  FontSize="18"   Margin="15,0,0,0"  Width="200" Name="txtFS03" Text="{Binding ABPART, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                            <TextBlock Background="White"  FontSize="18"   Margin="15,0,0,0"  Width="200" Text="{Binding FSABEZ, Converter={StaticResource ResourceKey=gb2312}, Source={ StaticResource ResourceKey=vwITXABPOS}}" />
                        </StackPanel>
                        <StackPanel>
                            <TextBox Background="Pink"  FontSize="18"     Width="100" Name="txtFS03C" Text="{Binding ABPFARBE, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" Margin="10,0,0,0" />
                            <TextBlock Background="White"  FontSize="18"   Margin="15,0,0,0"  Width="200" Text="{Binding FSFFBEZ, Converter={StaticResource ResourceKey=gb2312},  Source={ StaticResource ResourceKey=vwITXABPOS}}"/>
                        </StackPanel>
                        <TextBox Background="Plum"  FontSize="18"   Margin="10,0,0,0"  Width="20"  Text="{Binding ABPGROE, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=数量}}"></TextBlock>
                        <TextBox Background="White"  FontSize="16"   Margin="10,0,0,0"  Width="60"  
                                 Text="{Binding ABPSOLLMENGE7, Converter={StaticResource ResourceKey=d100}, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=交期}}"></TextBlock>
                        <TextBox Background="White"  FontSize="16"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding ABPLIEFDAT, Source={ StaticResource ResourceKey=vwITXABPOS}}" CharacterCasing="Upper" />
                    </WrapPanel>
                    <StackPanel Grid.Row="1" Grid.Column="0">
                        <DataGrid  x:Name="dlgAB05"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXABPOS}}"  
                                       AutoGenerateColumns="False" EnableRowVirtualization="False"
                                       VerticalScrollBarVisibility="Auto"
                                       HorizontalScrollBarVisibility="Auto" 
                                       VerticalAlignment="Stretch"
                                       HeadersVisibility="Column" 
                                       FontSize="14"
                                       Height="200"
                                       IsReadOnly="True"                               
                                       HorizontalAlignment="Stretch"
                                       EnableColumnVirtualization="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header="{Binding Source={Localization:Translate Word=供应}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header="" Width="Auto" MinWidth="20" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                    <StackPanel Grid.Row="1" Grid.Column="1">
                        <DataGrid  x:Name="dlgAB15"
                                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXAB15}}"  
                                       AutoGenerateColumns="False" EnableRowVirtualization="False"
                                       VerticalScrollBarVisibility="Auto"
                                       HorizontalScrollBarVisibility="Auto" 
                                       VerticalAlignment="Stretch"
                                       HeadersVisibility="Column" 
                                       FontSize="14"
                                       Height="200"
                                       IsReadOnly="True"
                                       HorizontalAlignment="Stretch"
                                       EnableColumnVirtualization="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABAART}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=计划}}" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAQTYALLOCATE}" Header="{Binding Source={Localization:Translate Word=分配}}" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}" Header="{Binding Source={Localization:Translate Word=供应}}" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS}" Header="" Width="Auto" MinWidth="20" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander DockPanel.Dock="Left"  ExpandDirection="Left" IsExpanded="True" Name="zonePlan">
                <StackPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=需求}}"></TextBlock>
                    <DataGrid  x:Name="dlgXDECK"
                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwXDECK}}"  
                       AutoGenerateColumns="False"
                     EnableRowVirtualization="False"
                       VerticalScrollBarVisibility="Auto"
                       HorizontalScrollBarVisibility="Auto"
                       VerticalAlignment="Stretch"
                       HeadersVisibility="Column" 
                       FontSize="14"
                            IsReadOnly="True"
                       HorizontalAlignment="Stretch"
                           RowDetailsVisibilityMode="Visible">
                        <DataGrid.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="5">
                                    <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=ARTDES, Converter={StaticResource ResourceKey=gb2312}}"/>
                                    <TextBlock>/</TextBlock>
                                    <TextBlock Foreground="CadetBlue" FontSize="16"                             
                            Text="{Binding Path=CDES, Converter={StaticResource ResourceKey=gb2312}}"/>
                                </StackPanel>
                            </DataTemplate>
                        </DataGrid.RowDetailsTemplate>
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ART}" Header="{Binding Source={Localization:Translate Word=辅料}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=REQ}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=UM}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                            <DataGridTextColumn Binding="{Binding Path=SELLER}" Header="{Binding Source={Localization:Translate Word=供应商}}" Width="Auto" MinWidth="40" />
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </Expander>
            <FlowDocumentScrollViewer  Name="FlowDocViewer" >
                <FlowDocument>
                    <Paragraph>

                    </Paragraph>
                    <Paragraph>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="100"></RowDefinition>
                                <RowDefinition Height="2*"></RowDefinition>
                                <RowDefinition Height="1*" MinHeight="200"></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*"></ColumnDefinition>
                                <ColumnDefinition Width="1*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <StackPanel  Grid.Row="0"  Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="2">
                                <WrapPanel>
                                    <StackPanel>
                                        <TextBlock Text="{Binding Source={Localization:Translate Word=采购单:类型}}"></TextBlock>
                                    </StackPanel>
                                    <TextBox Name="cmbKRS" Text="{Binding Source={Localization:Translate Word=MP}}" Width="30"></TextBox>
                                    <Button Name="btnPurchase" Width="30" Height="30"  Click="btnPurchase_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/IntexReportClient;component/Images/Add.png" />
                                        </Button.Background>
                                    </Button>
                                    <Button Name="btnRefreshPurchase" Width="30" Height="30"  Click="btnRefreshPurchase_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/refresh.png" />
                                        </Button.Background>
                                    </Button>
                                    <Button Name="btnITXPurchase" Width="30" Height="30"  IsEnabled="False" Click="btnITXPurchase_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/save.png" />
                                        </Button.Background>
                                    </Button>
                                    <ComboBox  ItemsSource="{Binding Source={StaticResource ResourceKey=vwLIEFDAT}}"
                                Background="Gray"  MinWidth="100" Text="{Binding EKPLIEFNR, Source={ StaticResource ResourceKey=vwITXEKPOS}}" 
                                       DisplayMemberPath="LSLIEFNA"
                                       IsEditable="True"
                                      SelectedValuePath="LSLIEFNR"
                                       >
                                    </ComboBox>
                                    <TextBlock  Background="Yellow"  MinWidth="30" Text="{Binding EKPAUFKRS, Source={ StaticResource ResourceKey=vwITXEKPOS}}" />
                                    <TextBox Background="Pink"  FontSize="18"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding EKPAUFLFD, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                                    <TextBox Background="PaleGreen"  FontSize="18"     Margin="10,0,0,0"  Width="40"  
                                 Text="{Binding EKPAUFPOS, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock>数量</TextBlock>
                                    <TextBox Background="White"  Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding EKPME1, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" />
                                    <WrapPanel>
                                        <TextBlock>价格</TextBlock>
                                        <TextBox Background="White"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding EKPPRME, Source={ StaticResource ResourceKey=vwITXEKPOS}, Converter={StaticResource ResourceKey=PreisConverter}}" CharacterCasing="Upper" />
                                    </WrapPanel>
                                    <TextBlock>交期</TextBlock>
                                    <TextBox Background="White"   Margin="10,0,0,0"  Width="100"  
                                 Text="{Binding EKPLTERM, Source={ StaticResource ResourceKey=vwITXEKPOS}}" CharacterCasing="Upper" 
                                     />
                                    <Button Name="imgneworder" Width="20"    IsEnabled="False" Visibility="Hidden" >
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/new.png" />
                                        </Button.Background>
                                    </Button>
                                </WrapPanel>
                            </StackPanel>
                            <StackPanel Grid.Row="1"  Grid.RowSpan="2" Grid.Column="0" >
                                <DataGrid  x:Name="dlgEKPOS" 
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXEKPOS}}"  
                                           AutoGenerateColumns="False" EnableRowVirtualization="False"
                                           VerticalScrollBarVisibility="Auto"
                                           HorizontalScrollBarVisibility="Auto"
                                           MaxHeight="300"
                                           VerticalAlignment="Stretch"
                                           HeadersVisibility="Column" 
                                           FontSize="14"
                                           HorizontalAlignment="Stretch"
                                           EnableColumnVirtualization="True">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Path=EKPQTYFREE}" Header="{Binding Source={Localization:Translate Word=可用}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPQTYLOCKED}" Header="{Binding Source={Localization:Translate Word=锁定}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPME1}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFKRS}" Header="" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD}" Header="{Binding Source={Localization:Translate Word=采购单}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS}" Header="" Width="Auto" MinWidth="40" />
                                    </DataGrid.Columns>
                                </DataGrid>
                                <DataGrid   
                                        Name="dlgTempEK"
                                        IsEnabled="False"
                                        Visibility="Hidden"
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTMPEKPOS}}"  
                                        AutoGenerateColumns="False" EnableRowVirtualization="False"
                                        VerticalScrollBarVisibility="Auto"
                                        HorizontalScrollBarVisibility="Auto"
                                        VerticalAlignment="Stretch"
                                        HeadersVisibility="Column" 
                                        FontSize="14"
                                        HorizontalAlignment="Stretch"
                                        EnableColumnVirtualization="True">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Path=EKPQTYFREE}" Header="{Binding Source={Localization:Translate Word=可用}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPQTYLOCKED}" Header="{Binding Source={Localization:Translate Word=锁定}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPME1}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=UM}}" Width="Auto" MinWidth="20" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFKRS}" Header="{Binding Source={Localization:Translate Word=采购单}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD}" Header="" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS}" Header="" Width="Auto" MinWidth="40" />
                                    </DataGrid.Columns>
                                </DataGrid>
                                <TextBlock>库存</TextBlock>
                                <DataGrid  
                                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXSTOCK}}"  
                                        AutoGenerateColumns="False" EnableRowVirtualization="False"
                                        VerticalScrollBarVisibility="Auto"
                                        HorizontalScrollBarVisibility="Auto"
                                        Height="Auto"
                                        VerticalAlignment="Stretch"
                                        HeadersVisibility="Column" 
                                        FontSize="14"
                                        HorizontalAlignment="Stretch"
                                    MaxHeight="300"
                                        EnableColumnVirtualization="True">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Path=QTYFREE}" Header="{Binding Source={Localization:Translate Word=可用}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=QTYLOCKED}" Header="{Binding Source={Localization:Translate Word=锁定}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=LO}" Header="{Binding Source={Localization:Translate Word=库}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=LB}" Header="{Binding Source={Localization:Translate Word=库区}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=LOT}" Header="{Binding Source={Localization:Translate Word=批号}}" Width="Auto" MinWidth="40" />
                                    </DataGrid.Columns>
                                </DataGrid>
                            </StackPanel>
                            <StackPanel Grid.Row="1"  Grid.RowSpan="1" Grid.Column="1" >
                                <WrapPanel>
                                    <Button Name="btnRefreshAllocation" Width="30" Height="30"  Click="btnRefreshAllocation_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/IntexReportClient;component/Resources/Images/32x32/application/refresh.png" />
                                        </Button.Background>
                                    </Button>
                                    <StackPanel>
                                        <TextBlock FontSize="12">明细:左键关联，右键取消</TextBlock>
                                        <TextBlock FontSize="12">手动更改数量，需要手动刷新。需要注意不能出现负数。</TextBlock>
                                    </StackPanel>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock>计划</TextBlock>
                                    <TextBox Background="White"  FontStyle="Italic" FontSize="18"   Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding ABAQTYRESERVE, Source={ StaticResource ResourceKey=vwITXXDECK}}" />
                                    <TextBlock>分配</TextBlock>
                                    <TextBox Background="White"  FontStyle="Italic" FontSize="18"    Margin="10,0,0,0"  Width="80"  
                                 Text="{Binding ABAQTYALLOCATE, Source={ StaticResource ResourceKey=vwITXXDECK}}"  />

                                </WrapPanel>
                                <DataGrid  x:Name="dlgITXXDECK"
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwITXXDECK}}"  
                                           AutoGenerateColumns="False" EnableRowVirtualization="False"
                                           VerticalScrollBarVisibility="Auto"
                                           HorizontalScrollBarVisibility="Auto"
                                           VerticalAlignment="Stretch"
                                           HeadersVisibility="Column" 
                                           FontSize="14"
                                           IsReadOnly="True"
                                           HorizontalAlignment="Stretch"
                                           MouseRightButtonUp="dlgITXDECK_MouseRightButtonUp"
                                           MouseLeftButtonUp="dlgITXDECK_MouseLeftButtonUp"
                                           EnableColumnVirtualization="True"     
                                           RowDetailsVisibilityMode="VisibleWhenSelected"
                                           >
                                    <DataGrid.RowDetailsTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                                                <TextBlock Foreground="Green" FontSize="12" Text="{Binding Path=ABAVKAUFKRS}"/>
                                                <TextBlock>/</TextBlock>
                                                <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFLFD}"/>
                                                <TextBlock Foreground="Green" FontSize="12"  Text="{Binding Path=ABAVKAUFPOS}"/>
                                                <TextBlock>来源</TextBlock>
                                                <TextBlock Foreground="Red" FontSize="12" Text="{Binding Path=ABAAUFKRS}"/>
                                                <TextBlock>/</TextBlock>
                                                <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFLFD}"/>
                                                <TextBlock Foreground="Red" FontSize="12"  Text="{Binding Path=ABAAUFPOS}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </DataGrid.RowDetailsTemplate>
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Path=LSLIEFNA}" Header="{Binding Source={Localization:Translate Word=加工厂}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=计划}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=ABAQTYALLOCATE}" Header="{Binding Source={Localization:Translate Word=分配}}" Width="Auto" MinWidth="40" />
                                        <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="60" />
                                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}" Width="Auto" MinWidth="20" />
                                        <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="20" />
                                        <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="40" />
                                    </DataGrid.Columns>
                                </DataGrid>
                            </StackPanel>
                        </Grid>
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>
            <ucd:WaitSpin Name="WaitPanel" AutoPlay="True" Elem="{Binding ElementName=FlowDocViewer}"/>
        </DockPanel>
    </Grid>
</local:DocumentBase>
